home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-18 | 33.2 KB | 1,130 lines |
- *******************************************************************************
- * PROGRAM: Musiview.wfm
- *
- * WRITTEN BY: Borland Samples Group
- *
- * DATE: 1/94
- *
- * UPDATED: 5/95
- *
- * REVISION: $Revision: 1.49 $
- *
- * VERSION: Visual dBASE
- *
- * DESCRIPTION: This is a form displaying the general view of all music
- * and other items sold in the Musical Methods store. You can
- * view this form in either edit or browse mode, change the
- * order of its display, view more or less information, depending
- * on your preference, search, and set a filter on the viewed
- * information. You can also view a report of the top 10.20 artists.
- *
- * PARAMETERS: None
- *
- * CALLS: Music.qbe (view of tables)
- * Music.cc (for custom pushbuttons)
- * View.mnu (menu file)
- * View.pop (popup file)
- * Music.prg (procedure file)
- *
- * USAGE: DO Musiview.wfm
- *
- *******************************************************************************
- #include <Messdlg.h>
- #include "Music.h"
- extern CINT WaveOutGetNumDevs( CVOID ) MmSystem.dll && Checks sound driver
-
- create session
- set talk off
- set ldcheck off
-
- ** END HEADER -- do not remove this line*
- * Generated on 07/11/95
- *
- parameter bModal
- local f
- f = new MUSIVIEWFORM()
- if (bModal)
- f.mdi = .F. && ensure not MDI
- f.ReadModal()
- else
- f.Open()
- endif
- CLASS MUSIVIEWFORM OF FORM
- Set Procedure To &_dbwinhome.samples\music\MUSIC.CC additive
- this.OnOpen = CLASS::ONOPEN
- this.Minimize = .F.
- this.MousePointer = 1
- this.ColorNormal = "W"
- this.OnClose = CLASS::ONCLOSE
- this.Maximize = .F.
- this.Top = 0.4111
- this.MenuFile = "VIEW.MNU"
- this.Left = 3.5
- this.Text = "Music -- Edit"
- this.OnNavigate = CLASS::ONNAVIGATE
- this.View = "MUSIC.QBE"
- this.Height = 18.7646
- this.Width = 79.5
-
- DEFINE RECTANGLE EDITRECT1 OF THIS;
- PROPERTY;
- ColorNormal "N/W",;
- Text "",;
- BorderStyle 1,;
- Height 5.3525,;
- Width 79.5
-
- DEFINE RECTANGLE EDITRECT2 OF THIS;
- PROPERTY;
- ColorNormal "N/W",;
- Top 5.3486,;
- Text "",;
- BorderStyle 1,;
- Height 11.2979,;
- Width 79.5
-
- DEFINE EMPHASIZEDTEXT RANKTEXT OF THIS;
- PROPERTY;
- Top 0.8984,;
- Left 3.2295,;
- Text "Rank:",;
- Alignment 5,;
- FontSize 10,;
- FontBold .F.,;
- Height 1.2773,;
- Width 16.1035
-
- DEFINE EMPHASIZEDENTRY RANKENTRY OF THIS;
- PROPERTY;
- Top 0.8984,;
- Left 20.2295,;
- FontSize 10,;
- Enabled .F.,;
- DataLink "RANK",;
- Height 1.2773,;
- Function "B",;
- Width 11.9365
-
- DEFINE MUSICBUTTON SOUNDBUTTON OF THIS;
- PROPERTY;
- Group .T.,;
- Top 0.3984,;
- StatusMessage "Listen to a sample of the recorded music.",;
- Default .T.,;
- Left 47.0986,;
- Text "S&le",;
- OnClick CLASS::PLAYSOUND,;
- UpBitmap "RESOURCE #618",;
- Height 1.4834,;
- Width 14.2344,;
- SpeedTip "Listen to sample"
-
- DEFINE MUSICBUTTON COVERBUTTON OF THIS;
- PROPERTY;
- Group .T.,;
- Top 0.3984,;
- StatusMessage "Look at the album cover.",;
- Left 62.3887,;
- Text "&Cover",;
- OnClick CLASS::SHOWCOVER,;
- UpBitmap "RESOURCE #617",;
- Height 1.4834,;
- Width 14.1113,;
- SpeedTip "Look at album cover"
-
- DEFINE EMPHASIZEDTEXT ARTISTTEXT OF THIS;
- PROPERTY;
- Top 2.2891,;
- Left 3.2295,;
- Text "Artist:",;
- Alignment 5,;
- FontSize 10,;
- FontBold .F.,;
- Height 1.2988,;
- Width 16.1035
-
- DEFINE EMPHASIZEDENTRY ARTISTENTRY OF THIS;
- PROPERTY;
- Top 2.2891,;
- Left 20.2295,;
- FontSize 10,;
- Enabled .F.,;
- DataLink "ARTIST",;
- Height 1.2988,;
- Width 57.2705
-
- DEFINE EMPHASIZEDTEXT TITLETEXT OF THIS;
- PROPERTY;
- Top 3.5781,;
- Left 3.2295,;
- Text "Title:",;
- Alignment 5,;
- FontSize 10,;
- FontBold .F.,;
- Height 1.3037,;
- Width 16.1035
-
- DEFINE EMPHASIZEDENTRY TITLEENTRY OF THIS;
- PROPERTY;
- Top 3.5781,;
- Left 20.2295,;
- FontSize 10,;
- Enabled .F.,;
- DataLink "TITLE",;
- Height 1.3037,;
- Width 57.2705
-
- DEFINE NORMALTEXT DESCRIPTIONTEXT OF THIS;
- PROPERTY;
- Top 5.8184,;
- Left 1.1895,;
- Text "Description:",;
- Alignment 5,;
- FontBold .F.,;
- Height 1.2402,;
- Width 16.1436
-
- DEFINE NORMALENTRY DESCRIPTIONENTRY1 OF THIS;
- PROPERTY;
- Top 5.8184,;
- Left 18.1895,;
- Enabled .F.,;
- DataLink "DESCRIPT1",;
- Height 1.2402,;
- Width 59.3105
-
- DEFINE NORMALENTRY DESCRIPTIONENTRY2 OF THIS;
- PROPERTY;
- Top 7.1387,;
- Left 18.1895,;
- Enabled .F.,;
- DataLink "DESCRIPT2",;
- Height 1.2725,;
- Width 59.3105
-
- DEFINE NORMALTEXT CATEGORYTEXT OF THIS;
- PROPERTY;
- Top 8.5186,;
- Left 1.1895,;
- Text "Category:",;
- Alignment 5,;
- FontBold .F.,;
- Height 1.2461,;
- Width 16.1436
-
- DEFINE NORMALENTRY CATEGORYENTRY OF THIS;
- PROPERTY;
- Top 8.5186,;
- Left 18.1895,;
- Enabled .F.,;
- DataLink "CATEGORS->DESCRIPT",;
- Height 1.2461,;
- Width 59.3105
-
- DEFINE NORMALTEXT PRIORITYTEXT OF THIS;
- PROPERTY;
- Top 9.8486,;
- Left 1.1895,;
- Text "Sales Ranking:",;
- Alignment 5,;
- FontBold .F.,;
- Height 1.2686,;
- Width 16.1436
-
- DEFINE NORMALENTRY PRIORITYENTRY OF THIS;
- PROPERTY;
- Top 9.8486,;
- Left 18.1895,;
- Enabled .F.,;
- DataLink "PRIORITS->DESCRIPT",;
- Height 1.2686,;
- Width 59.3105
-
- DEFINE NORMALTEXT CONFIGURATIONTEXT OF THIS;
- PROPERTY;
- Top 11.2988,;
- Left 1.1895,;
- Text "Media Type:",;
- Alignment 5,;
- FontBold .F.,;
- Height 1.2305,;
- Width 16.1436
-
- DEFINE NORMALENTRY CONFIGURATIONENTRY OF THIS;
- PROPERTY;
- Top 11.2988,;
- Left 18.1895,;
- Enabled .F.,;
- DataLink "CONFIGS->DESCRIPT",;
- Height 1.2305,;
- Width 43.8105
-
- DEFINE NORMALTEXT LISTPRICETEXT OF THIS;
- PROPERTY;
- Top 12.6895,;
- Left 1.1895,;
- Text "Sales Price:",;
- Alignment 5,;
- FontBold .F.,;
- Height 1.251,;
- Width 16.1436
-
- DEFINE NORMALENTRY LISTPRICEENTRY OF THIS;
- PROPERTY;
- Picture "999.99",;
- Top 12.6895,;
- Left 18.1895,;
- Enabled .F.,;
- DataLink "LIST_PRICE",;
- Height 1.0752,;
- Function "$B",;
- Width 9.8105
-
- DEFINE NORMALTEXT STREETDATETEXT OF THIS;
- PROPERTY;
- Top 12.6895,;
- Left 30.5986,;
- Text "Release Date:",;
- Alignment 5,;
- FontBold .F.,;
- Height 1.1924,;
- Width 16.2344
-
- DEFINE NORMALENTRY STREETDATEENTRY OF THIS;
- PROPERTY;
- Top 12.6895,;
- Left 47.2598,;
- Enabled .F.,;
- DataLink "STREET_DT",;
- Height 1.251,;
- Width 14.7402
-
- DEFINE PREVMBUTTON PREVMUSICBUTTON OF THIS;
- PROPERTY;
- Group .T.,;
- Top 14.2793,;
- Left 3.2295,;
- Text "&Prev",;
- OnClick CLASS::PREVBUTTONONCLICK,;
- Height 1.4854,;
- Width 14.1035
-
- DEFINE NEXTMBUTTON NEXTMUSICBUTTON OF THIS;
- PROPERTY;
- Group .T.,;
- Top 14.2793,;
- Left 18.1895,;
- Text "&Next",;
- OnClick CLASS::NEXTBUTTONONCLICK,;
- Height 1.4854,;
- Width 14.1436
-
- DEFINE MUSICBUTTON TOPMUSICBUTTON OF THIS;
- PROPERTY;
- Group .T.,;
- Top 14.2793,;
- StatusMessage "Go to the first item in the current order.",;
- Left 32.9795,;
- Text "&Top",;
- OnClick CLASS::TOPBUTTONONCLICK,;
- Height 1.4854,;
- Width 14.1865,;
- SpeedTip "First item in current order"
-
- DEFINE MUSICBUTTON BOTTOMMUSICBUTTON OF THIS;
- PROPERTY;
- Group .T.,;
- Top 14.2793,;
- StatusMessage "Go to the last item in the current order.",;
- Left 47.9395,;
- Text "&Bottom",;
- OnClick CLASS::BOTTOMBUTTONONCLICK,;
- Height 1.4854,;
- Width 14.2266,;
- SpeedTip "Last item in current order"
-
- DEFINE MUSICBUTTON MOREMUSICBUTTON OF THIS;
- PROPERTY;
- Group .F.,;
- HelpID "More",;
- Top 14.2793,;
- StatusMessage "See more information. Press F1 for Help.",;
- Left 62.7295,;
- Text "&More...",;
- OnClick CLASS::MORE,;
- Height 1.4854,;
- HelpFile "Music.hlp",;
- Width 14.1035,;
- SpeedTip "See more information"
-
- DEFINE CLOSEMBUTTON CLOSEMUSICBUTTON OF THIS;
- PROPERTY;
- Group .T.,;
- Top 17.0488,;
- Left 32.9795,;
- Height 1.5391,;
- Width 14.1865
-
- DEFINE IMAGE LOGOIMAGE OF THIS;
- PROPERTY;
- Top 0.7188,;
- Left 0.5098,;
- Alignment 2,;
- DataSource "FILENAME SMLMUSIC.BMP",;
- Height 3.8105,;
- Width 9.9902
-
- DEFINE NORMALTEXT CATALOGTEXT OF THIS;
- PROPERTY;
- Top 1.0186,;
- Left 82.4395,;
- Visible .F.,;
- Text "Catalog:",;
- Alignment 3,;
- Height 0.9814,;
- Width 13.5605
-
- DEFINE NORMALENTRY CATALOGENTRY OF THIS;
- PROPERTY;
- Picture "9999999",;
- Top 2.0391,;
- Left 82.4395,;
- Visible .F.,;
- DataLink "MUSIC->CATALOG",;
- Height 1.0195,;
- Function "B",;
- Width 13.5605
-
- DEFINE NORMALTEXT UPCTEXT OF THIS;
- PROPERTY;
- Top 4.0781,;
- Left 82.4395,;
- Visible .F.,;
- Text "UPC:",;
- Alignment 3,;
- Height 0.9805,;
- Width 13.5605
-
- DEFINE NORMALENTRY UPCENTRY OF THIS;
- PROPERTY;
- Top 5.0986,;
- Left 82.4395,;
- Visible .F.,;
- DataLink "MUSIC->UPC",;
- Height 1.0186,;
- Width 13.5605
-
- DEFINE NORMALTEXT LABELTEXT OF THIS;
- PROPERTY;
- Top 7.1387,;
- Left 82.4395,;
- Visible .F.,;
- Text "Label No:",;
- Alignment 3,;
- Height 0.9785,;
- Width 13.5605
-
- DEFINE NORMALENTRY LABELENTRY OF THIS;
- PROPERTY;
- Top 8.1592,;
- Left 82.4395,;
- Visible .F.,;
- DataLink "LABEL",;
- Height 1.0166,;
- Width 13.5605
-
- DEFINE NORMALTEXT LABELABBRTEXT OF THIS;
- PROPERTY;
- Top 10.1982,;
- Left 82.4395,;
- Visible .F.,;
- Text "Label:",;
- Alignment 3,;
- Height 0.9775,;
- Width 13.5605
-
- DEFINE NORMALENTRY LABELABBRENTRY OF THIS;
- PROPERTY;
- Top 11.2188,;
- Left 82.4395,;
- Visible .F.,;
- DataLink "MUSIC->LABEL_ABBR",;
- Height 1.251,;
- Width 13.5605
-
- DEFINE NORMALTEXT VPCTEXT OF THIS;
- PROPERTY;
- Top 13.2598,;
- Left 82.4395,;
- Visible .F.,;
- Text "VPC:",;
- Alignment 3,;
- Height 0.9746,;
- Width 13.5605
-
- DEFINE NORMALENTRY VPCENTRY OF THIS;
- PROPERTY;
- Top 14.2793,;
- Left 82.4395,;
- Visible .F.,;
- DataLink "MUSIC->VPC",;
- Height 1.25,;
- Width 13.5605
-
- DEFINE RECTANGLE DIVIDERRECT OF THIS;
- PROPERTY;
- ColorNormal "N/W",;
- Top -0.5,;
- Left 81.0889,;
- Visible .F.,;
- Text "Rectangle1",;
- Height 22.5586,;
- Width 0.2441
-
- procedure OnOpen
- ******************************************************************************
-
- if _app.framewin.text = MUSIC_APP_TITLE && If called from Music.prg
- EnableViews(this) && enable viewing other items,
- trackWindows.AddWindow(form) && Window adding paperwork
- else && otherwise
- set procedure to Music.prg additive && Make Music.prg procedure file
- endif
-
- *** Define Browse view controls (invisible at first)
- CLASS::DefineBrowseView()
-
- *** View Window Settings
- this.saveHeight = this.height && When form resized, original
- this.saveSmallWidth = this.width && size is restored
- this.saveLargeWidth = 100.0
-
- this.OnSize = CLASS::EditViewOnSize
-
- *** Assign the SpeedMenu for this form
- set procedure to View.pop additive
- this.popupMenu = new ViewPopup(this, "ViewPopup")
-
- *** Menu Settings
- this.root.AssignWindowMenu()
-
- *** Do calculations in another workarea so form is not affected
- use music in select() order rank alias temp
- go bottom in temp
- this.lastRec = recno("temp")
- go top in temp
- this.firstRec = recno("temp")
- use in temp
- ***
-
- this.filter = "" && No filter assigned yet
- this.inEditView = .T. && Start in Edit view
-
- *** Keep track of the current display order
- this.orderText = this.rankText
- this.orderEntry = this.rankEntry
- this.orderMenu = this.Root.View.Organization.Rank
- this.speedOrderMenu = this.popupMenu.Organization.Rank
- this.TopMusicButton.OnClick() && Go to first record in
- && current order
-
-
- ******************************************************************************
-
- procedure OnClose
- ******************************************************************************
-
- if _app.framewin.text = MUSIC_APP_TITLE && If running whole app, delete
- trackWindows.DeleteWindow(form) && form reference from
- else && trackWindows object
- close procedure Music.prg
- endif
- close procedure Music.cc, View.pop
-
-
- ******************************************************************************
-
- procedure DefineBrowseView
-
- * Creates Browse view of available items. All browse controls are initially
- * created to be invisible -- form starts out in Edit view.
- ******************************************************************************
-
- DEFINE RECTANGLE BROWSERECT OF form;
- PROPERTY;
- Top 0.10,;
- Left 0.01,;
- Height form.height - 3,;
- Width form.width -.2,;
- Text "",;
- BorderStyle 0,;
- Before form.logoImage,;
- ColorNormal "W",;
- Visible .F.
-
- DEFINE BROWSE MUSICBROWSE OF form;
- PROPERTY;
- Modify .F.,;
- ColorNormal "r/w",;
- ShowRecNo .F.,;
- Alias "Music",;
- Top form.browseRect.top + .5,;
- Left form.browseRect.left + 13,;
- Width form.browseRect.width - 14,;
- Height form.browseRect.height - 1,;
- Visible .F.
-
- form.musicBrowse.fields =;
- "rank, artist, title, categors->descript\h='MUSIC CATEGORY', configs->descript\h='MEDIA TYPE', priorits->descript\h='SALES RANKING', list_price\h='PRICE', street_dt\h='RELEASE DATE'\p='J', descript1\h='DESCRIPTION1', descript2\h='DESCRIPTION2'"
-
- DEFINE CLOSEMBUTTON BROWSECLOSEBUTTON OF form;
- PROPERTY;
- Top form.height - 2.02,;
- Left PB_COLUMN(form.width," Close ",1,1),;
- Visible .F.
-
-
- *******************************************************************************
-
- procedure EditView
-
- * Create Edit view of available items.
- * OnClick routine for BROWSE menu.
- *******************************************************************************
- private menu, speedMenu
-
- form.BrowseViewRelease() && Release Browse view controls
- form.inEditView = .T.
-
- form.text = "Music -- Edit" && Make title corresponding to window
-
- form.editRect1.visible = .T.
- form.editRect2.visible = .T.
- form.rankText.visible = .T.
- form.rankEntry.visible = .T.
- form.soundButton.visible = .T.
- form.coverButton.visible = .T.
- form.artistText.visible = .T.
- form.artistEntry.visible = .T.
- form.titleText.visible = .T.
- form.titleEntry.visible = .T.
- form.descriptionText.visible = .T.
- form.descriptionEntry1.visible = .T.
- form.descriptionEntry2.visible = .T.
- form.categoryText.visible = .T.
- form.categoryEntry.visible = .T.
- form.configurationText.visible = .T.
- form.configurationEntry.visible = .T.
- form.priorityText.visible = .T.
- form.priorityEntry.visible = .T.
- form.listPriceText.visible = .T.
- form.listPriceEntry.visible = .T.
- form.streetDateText.visible = .T.
- form.streetDateEntry.visible = .T.
- form.prevMusicButton.visible = .T.
- form.nextMusicButton.visible = .T.
- form.topMusicButton.visible = .T.
- form.bottomMusicButton.visible = .T.
- form.closeMusicButton.visible = .T.
- form.moreMusicButton.visible = .T.
- if form.moreMusicButton.text = "L&ess" && Show expanded view
- CLASS::More()
- endif
-
- CLASS::ReassignOrder(form)
- form.OnSize = form.EditViewOnSize
- form.OnNavigate()
-
- menu = form.root.view.browse
- speedMenu = form.popupMenu.browse
-
- menu.text = "&Browse"
- speedMenu.text = "&Browse"
- menu.OnClick = CLASS::BrowseView && Switch to Browse view next time
- speedMenu.OnClick = CLASS::BrowseView
-
-
-
- *******************************************************************************
-
- procedure EditViewRelease
-
- * Procedure called when view of this form is switched from Edit to Browse
- *******************************************************************************
-
- if form.moreMusicButton.text = "L&ess"
- CLASS::Less()
- endif
-
- * Make all Edit view controls invisible
- form.editRect1.visible = .F.
- form.editRect2.visible = .F.
- form.rankText.visible = .F.
- form.rankEntry.visible = .F.
- form.soundButton.visible = .F.
- form.coverButton.visible = .F.
- form.artistText.visible = .F.
- form.artistEntry.visible = .F.
- form.titleText.visible = .F.
- form.titleEntry.visible = .F.
- form.descriptionText.visible = .F.
- form.descriptionEntry1.visible = .F.
- form.descriptionEntry2.visible = .F.
- form.categoryText.visible = .F.
- form.categoryEntry.visible = .F.
- form.configurationText.visible = .F.
- form.configurationEntry.visible = .F.
- form.priorityText.visible = .F.
- form.priorityEntry.visible = .F.
- form.listPriceText.visible = .F.
- form.listPriceEntry.visible = .F.
- form.streetDateText.visible = .F.
- form.streetDateEntry.visible = .F.
- form.prevMusicButton.visible = .F.
- form.nextMusicButton.visible = .F.
- form.topMusicButton.visible = .F.
- form.bottomMusicButton.visible = .F.
- form.closeMusicButton.visible = .F.
- form.moreMusicButton.visible = .F.
-
-
-
- ******************************************************************************
-
- procedure EditViewOnSize
-
- * Procedure called whenever form is resized in Edit view.
- * Form is kept to a default size whenever it is resized.
- ******************************************************************************
-
- form.height = form.saveHeight
- form.width = iif(form.moreMusicButton.text = "L&ess",;
- form.saveLargeWidth,;
- form.saveSmallWidth)
-
-
-
-
- ******************************************************************************
-
- procedure BrowseView
-
- * Creates Browse view of available items.
- * OnClick routine for BROWSE menu.
- ******************************************************************************
- private menu, speedMenu
-
- form.EditViewRelease() && Don't show Edit view controls
-
- form.inEditView = .F.
- form.text = "Music -- Browse"
- form.OnSize = CLASS::BrowseViewOnSize && Different size routine
-
- form.browseRect.visible = .T. && Show Browse view controls
- form.musicBrowse.visible = .T.
- form.browseCloseButton.visible = .T.
-
- show object form.musicBrowse && Update Browse control
-
- menu = form.root.view.browse
- speedMenu = form.popupMenu.browse
- menu.text = "&Edit" && Next menu click show Edit
- speedMenu.text = "&Edit" && view
- menu.OnClick = CLASS::EditView
- speedMenu.OnClick = CLASS::EditView
-
-
-
- ******************************************************************************
-
- procedure BrowseViewRelease
-
- * Procedure called when view of this form is switched from Browse to Edit
- ******************************************************************************
-
- form.browseRect.visible = .F.
- form.musicBrowse.visible = .F.
- form.browseCloseButton.visible = .F.
-
-
- ******************************************************************************
-
- procedure BrowseViewOnSize
-
- * Procedure called whenever form is resized in Browse view.
- * Form is kept to a default size whenever it is resized.
- ******************************************************************************
-
- form.browseCloseButton.left = PB_COLUMN(form.width,;
- form.browseCloseButton.text, 1, 1)
- form.browseCloseButton.top = form.height - 2.02
- form.browseRect.height = form.height - 3
- form.browseRect.width = form.width - .2
- form.musicBrowse.height = form.browseRect.height - 1
- form.musicBrowse.width = form.browseREct.width - 14
-
-
- *******************************************************************************
-
- procedure PlaySound
-
- * Play sample of music for the current album
- *******************************************************************************
-
- if .not. empty(music->sound)
- if WaveOutGetNumDevs() = 0 && If no sound driver, give warning
- InformationMessage(;
- "A sound driver is required to listen to a music sample.",;
- "Information")
- else
- play sound binary music->sound
- endif
- else
- InformationMessage("There is no music sample available for this album.",;
- "Information")
- endif
-
-
- *******************************************************************************
-
- procedure ShowCover
-
- * Display the cover for the current music album
- *******************************************************************************
- local coverForm
-
- if .not. empty(music->cover)
- coverForm = new ImageForm() && This class is defined in this file
- coverForm.ReadModal()
- else
- InformationMessage("The cover for this album is not available.",;
- "Information")
- endif
-
-
- *******************************************************************************
-
- procedure PrevButtonOnclick
-
- * Skip to the previous record until bof()
- *******************************************************************************
-
- if recno() <> form.firstRec
- skip -1
- endif
-
-
- *******************************************************************************
-
- procedure NextButtonOnclick
-
- * Skip to the next record, until eof()
- *******************************************************************************
-
- if recno() <> form.lastRec
- skip
- endif
-
-
- *******************************************************************************
-
- procedure TopButtonOnClick
-
- * Go to first record in current order
- *******************************************************************************
-
- go top
-
-
- *******************************************************************************
-
- procedure BottomButtonOnClick
-
- * Go to last record in current order
- *******************************************************************************
-
- go bottom
-
-
- *******************************************************************************
-
- procedure OnNavigate
-
- * Procedure called when navigating through Music table.
- * Makes sure appropriate buttons are grayed out when at first/last record.
- *******************************************************************************
- local curRec
-
- if form.inEditView && If form in Edit view
- curRec = recno()
- do case
- case curRec = form.firstRec .or. bof()
- CLASS::DisableButton(form.topMusicButton)
- CLASS::EnableButton(form.bottomMusicButton)
- CLASS::EnableButton(form.nextMusicButton)
- CLASS::DisableButton(form.prevMusicButton)
- case curRec = form.lastRec .or. eof()
- CLASS::DisableButton(form.bottomMusicButton)
- CLASS::EnableButton(form.topMusicButton)
- CLASS::EnableButton(form.prevMusicButton)
- CLASS::DisableButton(form.nextMusicButton)
- otherwise
- CLASS::EnableButton(form.nextMusicButton)
- CLASS::EnableButton(form.bottomMusicButton)
- CLASS::EnableButton(form.prevMusicButton)
- CLASS::EnableButton(form.topMusicButton)
- endcase
- endif
-
- ******************************************************************************
-
- procedure More
-
- * Procedure called when MoreButton is selected to display more information.
- ******************************************************************************
-
- this.text = "L&ess"
- this.helpId = "Less"
- this.OnClick = CLASS::Less
- this.SpeedTip = "See basic information"
- this.StatusMessage = "See the basic information. Press F1 for Help."
- form.width = 100.0
-
- * Make extra controls visible
- form.labelText.visible = .T.
- form.labelEntry.visible = .T.
- form.labelAbbrText.visible = .T.
- form.labelAbbrEntry.visible = .T.
- form.catalogText.visible = .T.
- form.catalogEntry.visible = .T.
- form.vpcText.visible = .T.
- form.vpcEntry.visible = .T.
- form.upcText.visible = .T.
- form.upcEntry.visible = .T.
- form.dividerRect.visible = .T.
-
-
- ******************************************************************************
-
- procedure Less
-
- * Procedure called when MoreButton is selected to display less information.
- ******************************************************************************
-
- form.width = form.dividerRect.left
- form.moreMusicButton.text = "&More..."
- form.moreMusicButton.helpId = "More"
- form.moreMusicButton.OnClick = CLASS::More
- this.SpeedTip = "See more information"
- form.moreMusicButton.StatusMessage = "See more information. Press F1 for Help."
-
- * Make extra controls invisible
- form.labelText.visible = .F.
- form.labelEntry.visible = .F.
- form.labelAbbrText.visible = .F.
- form.labelAbbrEntry.visible = .F.
- form.catalogText.visible = .F.
- form.catalogEntry.visible = .F.
- form.vpcText.visible = .F.
- form.vpcEntry.visible = .F.
- form.upcText.visible = .F.
- form.upcEntry.visible = .F.
- form.dividerRect.visible = .F.
-
-
-
- *******************************************************************************
-
- procedure UpdateOrderControls(textControl, entryControl)
-
- * Update field colors according to current order
- *******************************************************************************
-
- if form.inEditView .and. .not. empty(textControl)
- form.orderText.colornormal = "n/w"
- form.orderEntry.colornormal = "r/w"
- show object form.orderText
- show object form.orderEntry
- form.orderText = textControl
- form.orderEntry = entryControl
- form.orderText.colornormal = "r/w"
- form.orderEntry.colornormal = "w+/r"
- show object form.orderText
- show object form.orderEntry
- endif
-
-
- *******************************************************************************
-
- procedure EnableButton(b)
-
- * Enables parameter button.
- *******************************************************************************
-
- b.enabled = .T.
- b.tabstop = .T.
-
-
- *******************************************************************************
-
- procedure DisableButton(b)
-
- * Disables parameter button.
- *******************************************************************************
-
- b.enabled = .F.
- b.tabstop = .F.
-
-
- *******************************************************************************
-
- procedure ShowArtistsView(menu, speedMenu)
-
- * Displays information ordered by Artist.
- *******************************************************************************
-
- if order() <> "ARTIST" && If not already ordered by Artist
- set order to artist
- if form.inEditView && Check if in Edit Mode
- CLASS::ChangeOrder(form.artistText, form.artistEntry, menu, speedMenu)
- else
- CLASS::ChangeOrder(.F., .F., menu, speedMenu)
- endif
- endif
-
-
- *******************************************************************************
-
- procedure ShowTitlesView(menu, speedMenu)
-
- * Displays information ordered by Title.
- *******************************************************************************
-
- if order() <> "TITLE" && If not already ordered by Title
- set order to title
- if form.inEditView && Check if in Edit Mode
- CLASS::ChangeOrder(form.titleText, form.titleEntry, menu, speedMenu)
- else
- CLASS::ChangeOrder(.F., .F., menu, speedMenu)
- endif
- endif
-
-
- *******************************************************************************
-
- procedure ShowRankView(menu, speedMenu)
-
- * Displays information ordered by Rank.
- *******************************************************************************
-
- if order() <> "RANK" && If not already ordered by Rank
- set order to rank
- if form.inEditView && Check if in Edit Mode
- CLASS::ChangeOrder(form.rankText, form.rankEntry, menu, speedMenu)
- else
- CLASS::ChangeOrder(.F., .F., menu, speedMenu)
- endif
- endif
-
-
-
- *******************************************************************************
-
- procedure ChangeOrder(textControl, entryControl, menuOrderSelected, speedMenu)
-
- * Changes current display order of information.
- *******************************************************************************
- private curOrder
-
- curOrder = order()
- form.orderMenu.checked = .F.
- form.speedOrderMenu.checked = .F.
- form.orderMenu = menuOrderSelected
- form.speedOrderMenu = speedMenu
- form.orderMenu.checked = .T.
- form.speedOrderMenu.checked = .T.
-
- * Do calculations in temp workarea
- use music in select() again alias temp
- select temp
- set order to &curOrder
- go bottom
- form.lastRec = recno() && For checking for eof/bof when skipping
- go top
- form.firstRec = recno()
- select music
- use in temp
- && Update current order controls
- form.UpdateOrderControls(textControl, entryControl)
-
-
- ******************************************************************************
-
- procedure ReassignOrder
-
- * Reassigns references to order text and entry.
- ******************************************************************************
- private order
-
- order = setto("order")
- do case
- case order = "RANK"
- form.UpdateOrderControls(form.rankText, form.rankEntry)
- case order = "ARTIST"
- form.UpdateOrderControls(form.artistText, form.artistEntry)
- case order = "TITLE"
- form.UpdateOrderControls(form.titleText, form.titleEntry)
- endcase
-
-
-
-
-
- ENDCLASS
-
-
- *******************************************************************************
- *******************************************************************************
- CLASS IMAGEFORM OF FORM
-
- * Class for displaying album covers in a modal form
- *******************************************************************************
-
- this.Height = 17.68
- this.Width = 44.37
- this.Top = 3.03
- this.Left = 21.59
- this.Text = "Cover"
- this.MDI = .F.
- this.ColorNormal = "W"
-
- DEFINE RECTANGLE IMAGERECT OF THIS;
- PROPERTY;
- Height 15.55,;
- Width 44.20,;
- Top 0.10,;
- Left 0.17,;
- Border .T.,;
- Text "",;
- ColorNormal "W"
-
- DEFINE IMAGE COVERIMAGE OF THIS;
- PROPERTY;
- Height 14.80,;
- Width 42.50,;
- Top 0.41,;
- Left 1.02,;
- Alignment 1,;
- DataSource "BINARY MUSIC->COVER"
-
- DEFINE CLOSEMBUTTON CLOSEIMAGEBUTTON OF THIS;
- PROPERTY;
- Top 16.16,;
- Left 16.15
-
-
- ENDCLASS
-
-
-
-